home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / laptop-mode-tools.preinst < prev    next >
Text File  |  2009-10-06  |  1KB  |  39 lines

  1. #!/bin/sh -e
  2.  
  3. # Remove a no-longer used conffile (from http://wiki.debian.org/DpkgConffileHandling)
  4. rm_conffile() {
  5.     PKGNAME="$1"
  6.     CONFFILE="$2"
  7.     if [ -e "$CONFFILE" ]; then
  8.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  9.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\'^ $CONFFILE[[:space:]]'{s/ obsolete$//;s/.* //p}\"`"
  10.         if [ "$md5sum" != "$old_md5sum" ]; then
  11.             echo "Obsolete conffile $CONFFILE has been modified by you."
  12.             echo "Saving as $CONFFILE.dpkg-bak ..."
  13.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  14.         else
  15.             echo "Removing obsolete conffile $CONFFILE ..."
  16.             rm -f "$CONFFILE"
  17.         fi
  18.     fi
  19. }
  20.  
  21. if [ "$1" = "upgrade" -o "$1" = "remove" ]; then
  22.        # Remove any previously installed acpi files
  23.        rm -f /etc/acpi/events/lm_ac_adapter
  24.        rm -f /etc/acpi/events/lm_battery
  25.        rm -f /etc/acpi/events/lm_lid
  26.  
  27.        rm -f /etc/acpi/actions/lm_ac_adapter.sh
  28.        rm -f /etc/acpi/actions/lm_battery.sh
  29.        rm -f /etc/acpi/actions/lm_lid.sh
  30.        rm -f /etc/apm/event.d/laptop-mode
  31. fi
  32.  
  33. if dpkg --compare-versions "$2" lt-nl 1.47-1ubuntu2; then
  34.     rm_conffile laptop-mode-tools /etc/pm/sleep.d/99laptop-mode
  35. fi
  36.  
  37.  
  38.  
  39.